package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    /**
     * 添加口味
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);


    /**
     * 通过菜品Id删除口味
     */
    @Delete("delete from dish_flavor where dish_id = #{dishId}")
    void deleteByDishId(long dishId);


    /**
     * 根据菜品Id集合批量删除口味
     * @param dishIds
     */
    void deleteByDishIds(List<Long> dishIds);

    /**
     * 根据菜品id查看口味
     * @param dishId
     * @return
     */
    List<DishFlavor> getByDishId(Long dishId);

}
